<?php
if(!defined('ADMIN')){
	exit('Access Denied');
}

if($_POST['sub']=='save'){
    $listorder=$_POST["listorder"];
    if(!empty($listorder)){
     while(list($k,$v)=each($listorder)){
        
        $data=array("listorder"=>$v);
        $ezhand->update("category",$data,'id='.$k);  
            
        
     }  
    }   
    
}

$modellist=ez_get_cache("model");

$total=$ezhand->count("category","1=1");
$row=$ezhand->select_all("category",'*',"1=1 order by level asc,parentid asc,listorder asc");

?>